
#include<QDebug>
#include "stereovision.h"
#include<opencv2\opencv.hpp>
#include<qtimer.h>
StereoVision::StereoVision(QWidget *parent, Qt::WFlags flags)
	: QMainWindow(parent, flags)
{

	ui.setupUi(this);
	timer=new QTimer(this);
	timer->setInterval(35);
	/*ui.lCamera->setGeometry(0,0,400,300);
	ui.rCamera->setGeometry(420,0,400,300);
	ui.lCamera->show();
	ui.rCamera->show();*/
	qDebug()<<"StereoVison Constructor: " <<this->thread()->currentThread()<<this->thread()->currentThreadId();
	
}

void StereoVision::setCam(int i)
{
	
	
}

void StereoVision::openCam()
{
	lCameraThread.startCam(ui.lCamera,timer);
	rCameraThread.startCam(ui.rCamera,timer);
	timer->start();
}
void StereoVision::stopCam()
{
	lCameraThread.~cameraThread();
	rCameraThread.~cameraThread();
}
void StereoVision::pauseCam()
{

}


void StereoVision::paintEvent(QPaintEvent * e)
{
	
	
}
StereoVision::~StereoVision()
{

}
